﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VO;
namespace DAL
{
    class ChiTietHoaDon_DAO:SqlDataProvider
    {
        #region[Customer_Insert]
        public bool Customer_Insert(ChiTietHoaDon_OBJ _CTHoaDonOBJ)
        {
            using (SqlCommand dbCmd = new SqlCommand("Ins_CT_HD", GetConnection()))
            {
                dbCmd.CommandType = CommandType.StoredProcedure;
                dbCmd.Parameters.Add(new SqlParameter("@MaHoaDon",_CTHoaDonOBJ.MaHoaDon));
                dbCmd.Parameters.Add(new SqlParameter("@MaSach",_CTHoaDonOBJ.MaSach));
                dbCmd.Parameters.Add(new SqlParameter("@DonGia",_CTHoaDonOBJ.DonGia));
                dbCmd.Parameters.Add(new SqlParameter("@SoLuong",_CTHoaDonOBJ.SoLuong));
                dbCmd.Parameters.Add(new SqlParameter("@ThanhTien",_CTHoaDonOBJ.ThanhTien));
                dbCmd.ExecuteNonQuery();
            }
            return true;
        }
        #endregion
    }
}
